package com.rbmh.network.utils;

import com.rbmh.network.bean.entity.DbInfo;

import java.net.InetAddress;

public class NetworkUtils {

    public static boolean ping(DbInfo dbInfo, int timeoutMs) {
        try {
            InetAddress address = InetAddress.getByName(dbInfo.getIpAddress());
            return address.isReachable(timeoutMs);
        } catch (Exception e) {
            return false;
        }
    }
}
